From ffdb781883abd3215287ba1b1853f3d437d1240c Mon Sep 17 00:00:00 2001 From: Don Slutz Date: Mon, 23 Mar 2015 16:53:44 +0100 Subject: [PATCH] x86/hvm: prevent gcc uninitialised var warning gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 reports: ---------------------------------------------------------------------- hvm.c: In function `hvm_create_ioreq_server': hvm.c:487:18: error: `bufioreq_pfn' may be used uninitialised in this function [-Werror=uninitialized] hvm.c:718:30: note: `bufioreq_pfn' was declared here ---------------------------------------------------------------------- My code analysis says that gcc is wrong, but initilize the variable to prevent the gcc warning. Reported-by: Ian Murray Signed-off-by: Don Slutz --- xen/arch/x86/hvm/hvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 4734d7112f..dd6b0d0e3d 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -733,7 +733,8 @@ static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s, bool_t is_default, bool_t handle_bufioreq) { struct domain *d = s->domain; - unsigned long ioreq_pfn, bufioreq_pfn; + unsigned long ioreq_pfn; + unsigned long bufioreq_pfn = ~0UL; /* gcc uninitialised var warning */ int rc; if ( is_default ) -- 2.30.2